import axios from "axios";
const instance = axios.create()

// 请求拦截器
instance.interceptors.request.use(config => {
  config.timeout = 10000
  return config
})

// 响应拦截器
instance.interceptors.response.use(res => res.data, err => {
  return Promise.reject(err)
})

export const get = (url, config = {}) => instance.get(url, config)

export const post = (url, data = {}, config = {}) => instance.post(url, data, config)

